CachedSynchronizedSet

Ecng.Collections

Represents a thread-safe set with a cached array of its elements for improved performance.

继承自: SynchronizedSet<T>

构造函数

CachedSynchronizedSet
public CachedSynchronizedSet()
cachedSynchronizedSet = CachedSynchronizedSet()

Initializes a new instance of the CachedSynchronizedSet class.

CachedSynchronizedSet
public CachedSynchronizedSet(bool allowIndexing)
cachedSynchronizedSet = CachedSynchronizedSet(allowIndexing)

Initializes a new instance of the CachedSynchronizedSet class with the specified indexing option.

allowIndexing
A value indicating whether indexing is allowed.
CachedSynchronizedSet
public CachedSynchronizedSet(IEnumerable<T> collection)
cachedSynchronizedSet = CachedSynchronizedSet(collection)

Initializes a new instance of the CachedSynchronizedSet class with the specified collection.

collection
The collection whose elements are copied to the new set.
CachedSynchronizedSet
public CachedSynchronizedSet(IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(comparer)

Initializes a new instance of the CachedSynchronizedSet class with the specified equality comparer.

comparer
The equality comparer to use when comparing elements.
CachedSynchronizedSet
public CachedSynchronizedSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(collection, comparer)

Initializes a new instance of the CachedSynchronizedSet class with the specified collection and equality comparer.

collection
The collection whose elements are copied to the new set.
comparer
The equality comparer to use when comparing elements.
CachedSynchronizedSet
public CachedSynchronizedSet(bool allowIndexing, IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(allowIndexing, comparer)

Initializes a new instance of the CachedSynchronizedSet class with the specified indexing option and equality comparer.

allowIndexing
A value indicating whether indexing is allowed.
comparer
The equality comparer to use when comparing elements.
CachedSynchronizedSet
public CachedSynchronizedSet(bool allowIndexing, IEnumerable<T> collection, IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(allowIndexing, collection, comparer)

Initializes a new instance of the CachedSynchronizedSet class with the specified indexing option, collection, and equality comparer.

allowIndexing
A value indicating whether indexing is allowed.
collection
The collection whose elements are copied to the new set.
comparer
The equality comparer to use when comparing elements.

属性

Cache
public T[] Cache { get; }
value = cachedSynchronizedSet.Cache

Gets a cached array of the elements in the set.

方法

OnChanged
protected override void OnChanged()
cachedSynchronizedSet.OnChanged()

Called when the set is modified to reset the cached array.